// Initial File - Paul Jack

#ifndef __USBDEVICE_H__
#define __USBDEVICE_H__

// Jungo Driver.  Leave this so it is included just from one place.
#include <wdu_lib.h>
#include "commdevice.h"
#include "usbconstants.h"




class UsbDevice: public CommDevice
{

public:

    UsbDevice(int cmdPipe = USB_CMD_PIPE,
              int respPipe = USB_RESP_PIPE,
              int bulkPipe = USB_BULK_PIPE,
              int writeTimeout = USB_WRITE_TIMEOUT,
              int readTimeout = USB_READ_TIMEOUT,
              int bulkTimeout = USB_BULK_TIMEOUT,
              bool crLf = true);


    bool write(const QByteArray &str);
    bool readBulk(QByteArray &array);
    bool read(QByteArray &str);
    bool isConnected (void);
    void setConnected(bool);
    QString getIdentification();
    QString getDescription();
    void removeCrLf( bool remove );
    void initialize( void ){};


    quint32 getReadBulkErrorCode( void );
    quint32 getReadErrorCode( void );
    quint32 getWriteErrorCode( void );


private:
    QByteArray mBuffer;
    bool mDisplayMessages;

    int mCmdPipe;
    int mRespPipe;
    int mBulkPipe;
    int mWriteTimeout;
    int mReadTimeout;
    int mBulkTimeout;
    bool mRemoveCrLf;
    quint32 mWriteErrorCode;
    quint32 mReadBulkErrorCode;
    quint32 mReadErrorCode;
    

    
    
};

#endif //__USBDEVICE_H__